
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta http-equiv="Pragma" content="no-cache" />
		<meta http-equiv="Cache-Control" content="no-cache" />
		<meta http-equiv="Expires" content="0" />
		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
		<title>Devops平台-登录</title>
		<link rel="stylesheet" href="src/assets/css/ng-common/ng-reset.css" />
		<link rel="stylesheet" href="src/assets/css/ng-common/ng-common.css" />
		<link rel="stylesheet" href="src/assets/css/ng-common/ng-components.css" />
		<!-- login style -->
		<link rel="stylesheet" href="src/assets/css/demo.css" />
		<link rel="stylesheet" href="src/assets/css/login_test.css" />
	</head>

	<body oncontextmenu="return false;">
		<div class="page_blk">
			<!--顶线-->
			<div class="top_line">
				<div class="top_line_left"></div>
				<div class="top_line_right"></div>
			</div>
			<!--主区域-->
			<div class="main_blk">

				<div class="main_form">
					<div class="form_blk">

						<form autocomplete="off" id="formw">
							
							
							
							
							
							<!--  登录页面   -->
							<div class="page-w">
								<div class="tit_login">
									<!-- <img src="src/assets/img/loginx.png"/> -->
								</div>

								<div class="page-w2">
									<div class="login-panel">
									<div class="loginbar">

										<div class="loginbar-right">
											
											<span class="span1w">
												<img src="src/assets/img/admin.png">
											</span>
											<span class="span2w">账号:</span>
											
											<input name="l_u" type="text" autocomplete="off"  onfocus="this.placeholder=''"/>
										</div>
									</div>
									
									<div class="msg-w">
										
										<div class="UppercaseLock msgx-w hide">
											<span class="tips">大写锁定已开启</span>
										</div>
									</div>
									
									<div class="loginbar">

										<div class="loginbar-right">
											
											<span class="span1w">
												<img src="src/assets/img/mm.png">
											</span>
											<span class="span2w">密码:</span>
											
											<input type="text" autocomplete="off" onfocus="this.type='password'" name="l_p" onpaste="return false" oncontextmenu="return false" onfocus="this.placeholder=''" oncopy="return false" oncut="return false"/>
										</div>
									</div>
									
									<div class="msg-w"></div>
									
									<div class="copy-w">
										<div class="copy-w2left">
											<span>验证码:</span>
											<input type="text" name="l_sc" placeholder="" />
										</div>
										<div class="copy-w3left">
											<a href="javascript:;" id="l_gsc" class="get_num">
												获取验证码
											</a>
										</div>										
									</div>
									
									<div class="msg-w2">
										
										<div id="loginTips" class="msgx-w hide">
											<span class="tips">账号、密码或验证码错误.</span>
											
											<span id="timer" class="Countdown"></span>											
										</div>
									</div>
									
									<div class="shop-w">
										<a href="javascript:;" class="forget">忘记密码?</a>
										<a href="javascript:;" class="reset">重置</a>								
									</div>
									
									<div class="loginbar-w">
										<input type="button" value="登录" class="loginbar-w2 login_bt"/>
									</div>
									</div>
								</div>
							</div>
							
							

							<!-- 忘记密码 -->
							<div class="page-w-two hide">
								<div class="forget-panel">
									<table class="xiutab-w" border="0" cellspacing="0" cellpadding="0">
										<tr class="xiutr-w1">
											<!--<td><img src="src/assets/img/tit_login2.png" width="286" height="30" /></td>-->
											<td style="line-height: 70px;">
												<span style="float: left">找回密码</span>
												<span style="float: right;padding-right: 20px;">
												<img src="src/assets/img/end.png" style="cursor: pointer;">
											</span>
												
											</td>
										</tr>
										<tr class="process-w">
											<td>
												<div class="exam-w">
													<div class="heng-w">
														<div class="syan-w">1</div>
														<div class="heng-w1"></div>
														<div class="czhi-w">2</div>
														<div class="heng-w2"></div>
														<div class="zhui-w">3</div>
													</div>
												</div>
												<div class="text-w">
													<div>手机验证</div>
													<div>重置密码</div>
													<div>找回成功</div>
												</div>
											</td>
										</tr>
										<tr>
											<td valign="middle">
												<table border="0" cellspacing="0" cellpadding="0" style="margin:  0 auto;">
													<tr>
														<td>
															<div class="account-w">
																<span></span>
																<input type="text" name="f_u" placeholder="账号" />
															</div>
														</td>
													</tr>
													<tr>

														<td>
															<div class="phone-w">
																<span></span>
																<input type="text" name="f_m" placeholder="手机号" />
															</div>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr valign="top">
											<td align="left">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td>
															<div class="codew">
																<input type="text" name="f_sc" style="width:120px;" placeholder="短信验证码" />

																<a href="javascript:;" id="f_gsc" class="get_num">获取验证码</a>
															</div>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td>
												<div class="tips-info hide"><span class="color-red"></span></div>
											</td>
										</tr>
										<tr>
											<td>
												<div class="codew">
													<a href="javascript:;" class="login_bt">下一步</a>
												</div>
												<!--<a href="javascript:;" class="reset">重置</a>
                                            <a href="javascript:;" class="back">返回</a>-->
											</td>
										</tr>
									</table>
								</div>
							</div>
							<!-- 重置密码 -->
							<div class="page-w-three hide">
								<div class="reset-panel">
									<!-- 类型：forget or expire -->
									<input type="hidden" name="reset_type" value="forget" />
									<input type="hidden" name="u" />
									<table class="xiutab-w" border="0" cellspacing="0" cellpadding="0">
										<tr class="xiutr-w1">
											<!--                                        <td><img src="src/assets/img/tit_login3.png" width="286" height="30" /></td>-->
											<td style="line-height: 70px;">
												<span style="float: left;">找回密码</span>
												<span style="float: right;padding-right: 20px;">
												<img src="src/assets/img/end.png" style="cursor: pointer;">
											</span>
												
											</td>
										</tr>
										<tr class="process-w">
											<td>
												<div class="exam-w">
													<div class="heng-w">
														<div class="syan-w">1</div>
														<div class="heng-w1-lv"></div>
														<div class="czhi-w-lv">2</div>
														<div class="heng-w2"></div>
														<div class="zhui-w">3</div>
													</div>
												</div>
												<div class="text-w">
													<div>手机验证</div>
													<div>重置密码</div>
													<div>找回成功</div>
												</div>
											</td>
										</tr>
										<tr>
											<td>
												<div class="tips-pwdV hide"><span class="color-red">请输入6位以上的字母、数字和特殊符号的组合</span></div>
											</td>
										</tr>
										<tr>
											<td valign="middle">
												<table border="0" cellspacing="0" cellpadding="0" style="margin: 0 auto;">
													<tr>
														<td class="txt-w">新登录密码:&nbsp;&nbsp;</td>
														<td>
															<div class="account-w2">
																<input type="password" name="newpwd" placeholder="" />
															</div>
														</td>
													</tr>
													<tr>
														<td class="txt-w">确认新密码:&nbsp;&nbsp;</td>

														<td>
															<div class="account-w2">
																<input type="password" name="renewpwd" placeholder="" />
															</div>
														</td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td>
												<div class="tips-pwdV1 hide ">
													<span class="color-red">请输入6位以上的字母、数字和特殊符号的组合</span>
												</div>
											</td>
											<td>
												<div class="tips-pwdVV hide"><span class="color-red">密码不能为空，请输入密码！</span></div>
											</td>
										</tr>
										<tr>
											<td>
												<div class="tips-info hide" style="width: 190px;">
													<span class="color-red"></span>
												</div>
											</td>
										</tr>
										<tr>
											<td>
												<div class="codew2">
													<a href="javascript:;" class="login_bt">下一步</a>
													<!--<a href="javascript:;" class="reset">重置</a>
                                            <a href="javascript:;" class="back">返回</a>-->
												</div>
											</td>
										</tr>
									</table>
								</div>
							</div>
							<!-- 重置成功   -->
							<div class="page-w-si hide">
								<div class="xiutr-w1">
									<span style="padding-left: 30px;">找回密码</span>
								</div>
								<div class="exam-w" style="margin-top: 28px;">
									<div class="heng-w">
										<div class="syan-w">1</div>
										<div class="heng-w1-lv"></div>
										<div class="syan-w">2</div>
										<div class="heng-w1-lv"></div>
										<div class="syan-w">3</div>
									</div>
								</div>
								<div class="text-w">
									<div>手机验证</div>
									<div>重置密码</div>
									<div>找回成功</div>
								</div>

								<div class="yes-w">
									<div class="ok-w"></div>
									<div class="ok-w2">新密码设置成功！下次登录时请使用新密码进行登录</div>
								</div>
								<div class="end-w">
									返回登录
								</div>
							</div>
							
							
							
							
							<!-- 首次登陆强制修改密码 -->
                            <div class="firstLanding hide">
                                <div class="forget-panel">
                                    <table class="xiutab-w" border="0" cellspacing="0" cellpadding="0">
                                        <tr class="xiutr-w1">
                                            <td style="line-height: 70px;">
                                                <span style="float: left">首次登录</span>
                                                <span style="float: left;font-size: 13px;margin-bottom: 0;color: #999999;line-height: 84px;height: 70px;" >【修改密码】</span>
                                                <span style="float: right;padding-right: 20px;">
                                                <img src="src/assets/img/end.png" style="cursor: pointer;">
                                            </span>
                                                
                                            </td>
                                        </tr>
                                        <tr class="process-w">
                                            <td>
                                                <div align="center">
                                                    <h2 style="color: #FF7B58;">您好，您是首次登录，需要修改密码后，方可进行后续操作......</h2>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="middle">
                                                <table border="0" cellspacing="0" cellpadding="0" style="margin: 0 auto;">
                                                    <tr>
                                                       <td><span>新登录密码:&nbsp;&nbsp;</span></td>
                                                        <td>
                                                        	
                                                            <div class="account-w23">
                                                                <input type="password" name="F_newpwd" placeholder="" />
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr style="height: 10px;"></tr>
                                                    <tr>
                                                        <td>确认新密码:&nbsp;&nbsp;</td>

                                                        <td>
                                                            <div class="account-w23">
                                                                <input type="password" name="F_renewpwd" placeholder="" />
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <div class="F_resPwdv1 hide">
                                                                <span class="color-red">请输入6位以上的字母、数字和特殊符号的组合</span>
                                                            </div>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            <div class="F_resPwdV2 hide"><span class="color-red">密码不能为空，请输入密码！</span></div>
                                                        </td>
                                                    </tr>
                                                    
			                                        <tr>
			                                        	<td></td>
			                                            <td>
			                                                <div class="F_errorTips tips-info hide"><span class="color-red"></span></div>
			                                            </td>
			                                        </tr>                                                   
                                                </table>
                                            </td>
                                        </tr>
										<tr style="height: 10px;"></tr>
                                        <tr>
                                            <td>
                                                <div class="codew">
                                                    <a href="javascript:;" class="F_Next_btn">下一步</a>
                                                </div>
                                                <!--<a href="javascript:;" class="reset">重置</a>
                                            <a href="javascript:;" class="back">返回</a>-->
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>
                            
                            <!-- 首次登陆修改密码成功   -->
                            <div class="F_E_P hide">
                                <div class="xiutr-w1" style="line-height: 70px;padding-left: 30px;">
                                    <span style="float: left">首次登录</span>
                                    <span style="font-size: 16px;margin-bottom: 0;color: #999999;line-height: 84px;height: 70px;" >【密码修改成功】</span>
                                </div>

                                <div class="F_yes-w">
                                    <div class="ok-w"></div>
                                    <div class="ok-w2">新密码修改成功！请返回登录页后使用新密码进行登录</div>
                                </div>
                                <div class="end-w">
                                    返回登录
                                </div>
                            </div>
						
						
						</form>

					</div>
				</div>

			</div>
			<!--版权-->
			<div class="copyright_login"></div>
			<div class="logout hide"></div>

			<div class="winw" style="display: none;"></div>
			<div class="winw-w" style="display: none;">
				<div class="alertw">
					<a class="d1" target="_blank" href="http://www.firefox.com.cn/"></a>
					<a class="d2" target="_blank" href="https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads"></a>
					<a class="d3" target="_blank" href="http://www.google.cn/intl/zh-CN/chrome/browser/"></a>
				</div>
			</div>
		</div>
		<script>
			//解决ie下console.log()报错问题
			window.console = window.console || (function() {
				var c = {};
				c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile = c.clear = c.exception = c.trace = c.assert = function() {};
				return c;
			})();
			/**
			 * 每次上线前请修改这个版本号解决上线后资源缓存问题
			 * */
			window.Args = '20170815';
			window.UEDITOR_HOME_URL = 'src/assets/lib/ueditor/';
		</script>
		<!-- js -->
		<script src="src/js/common/requirejsMain_singlepage.js"></script>
		<script src="src/assets/lib/requirejs/requirejs.min.js"></script>
		<script type="text/javascript">
			require(['Util', 'cookie', 'base64', 'underscore', 'jquery.md5'], function(Util, $cookie, Base64, underscore) {

				var isCapslockOn;
				var pwdFalg = false;
				/** 获取当前时间  */
				//返回登录
				$('.end-w').click(function() {
					location.href = 'login.html';
				})
				
				
				$('.xiutr-w1 img').click(function(){
					location.href = 'login.html';
				})

				function getNowFormatDate(simple) {
					var date = new Date();
					var seperator1 = "-";
					var seperator2 = ":";
					var month = date.getMonth() + 1;
					var strDate = date.getDate();
					if(month >= 1 && month <= 9) {
						month = "0" + month;
					}
					if(strDate >= 0 && strDate <= 9) {
						strDate = "0" + strDate;
					}
					var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate +
						" " + date.getHours() + seperator2 + date.getMinutes() +
						seperator2 + date.getSeconds();
					var simpledate = date.getHours() + seperator2 + date.getMinutes() + seperator2 + date.getSeconds();
					return simple && simple == true ? simpledate : currentdate;
				}
				/** 立即执行 */
				$(function() {
					
					$('.reset').click(function() {
						timerflag = false;
						countdown = 0;
						$('#formw')[0].reset();
						$('#loginTips').addClass('hide');
					})

					// Util.ajax.postJson('/it/isLogin', {}, function(result, isOk) {
					// 	if(result.success) {
					// 		var data = result.message
					// 		$cookie.set("com.cmos.boco.bomc.userId", data.userId, 86400000);
					// 		$cookie.set("com.cmos.boco.bomc.userName", data.userName, 86400000);
					// 		$cookie.set("com.cmos.boco.bomc.loginTime", getNowFormatDate(true), 86400000)
					// 		location.href = 'index.html'
					// 	}
					// });
					$('body').bind("cut copy paste", function(e) {
						e.preventDefault();
					});
					$('body').bind("cut copy paste", function(e) {
						e.preventDefault();
					});
					$('body').bind("cut copy paste", function(e) {
						e.preventDefault();
					});
					//发送短信按钮倒计时标志，true的时候表示正在倒计时
					var timerflag = false;

					//点击发送短信按钮后倒计时60s
					var countdown = 60;

					function settime(obj) {
						if(countdown == 0) {
							//结束倒计时
							timerflag = false;
							obj.text("获取验证码");
							countdown = 60;
							return;
						} else {
							obj.text('重新获取' + countdown + "s");
							countdown--;
						}
						setTimeout(function() {
							settime($('#l_gsc'));
						}, 1000);
					}

					/** 获取验证码前首先校验用户名、密码是否正确  */
					var tflag = false; //是否正在5分钟倒计时中
					$('#l_gsc').click(function() {
						if(timerflag){
					        $('#loginTips .tips').text("验证码已发送，请在倒计时结束后再试。");
                            $('#loginTips').removeClass('hide');
					        return;
					    }
						var u = $('input[name="l_u"]').val();
						var p = $('input[name="l_p"]').val();
						if(u == '') {
							$('#loginTips .tips').text("请输入账号。");
							$('#loginTips').removeClass('hide');
							return;
						}

						if(p == '') {
							$('#loginTips .tips').text("请输入密码。");
							$('#loginTips').removeClass('hide');
							return;
						}

						if(u == '' || p == '' || tflag || timerflag) {
							return;
						}
						/** 隐藏历史提示消息回显  */
						$('#loginTips').addClass('hide');

						//校验用户名、密码
						var md5p = $.md5(p);
						Util.ajax.postJson('/it/checkPwd', {
							userId: u,
							password: md5p
						}, function(result, isOk) {
							if(result.returnCode && result.returnCode != '0') {
								alert("用户、密码错误,请稍后再试。");
							} else {
								if(result.success) { //校验成功
								    
									if(timerflag == true) {
										return;
									}
									/*if(result.data&&"First"==result.data){
									    firstLanding();
									}*/
									$('input[name="l_sc"]').val('');
									$('input[name="l_sc"]').removeAttr('disabled');
									$('input[name="l_sc"]').focus();
									timerflag = true;
									//发送验证码
									sendSmsCode($('input[name="l_u"]').val());
									settime($('#l_gsc'));
									$('input[name="l_sc"]').keydown(function(e) {
										var theEvent = e || window.event;
										var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
										if(code == 13) {
											$('.login-panel .login_bt').trigger('click');
											return false;
										}
										return true;
									});

								} else {
									//开始5分钟倒计时 300s
									var tflag = false;
									var secdown = 300;

									function _timer(obj) {
										if(secdown == 0) {
											//结束倒计时
											tflag = false;
											secdown = 300;
											setTimeout("location.href='login.html'", 1000);
											return;
										} else {
											obj.text("  剩余时间：" + secdown + " s");
											secdown--;
										}
										setTimeout(function() {
											_timer($('#timer'));
										}, 1000);
									}
									if(result.data && 'Locked' == result.data) {
										$('#loginTips .tips').text(result.message);
										$('#loginTips').removeClass('hide');
										//开始锁定5分钟倒计时
										tflag = true;
										_timer($('#span').text('300 s'));
									} else {
										$('#loginTips .tips').text(result.message);
										$('#loginTips').removeClass('hide');
									}
								}
							}
						});
					});

					//初始化事件
					eventInit();

					//聚焦账号
					$('input[name="l_u"]').focus();

				});

				function sendSmsCode(_userId) {
					var dicKey = "ITPORTAL_SMS_URL";
					Util.ajax.getJson("/it/getUrlsByKey/" + dicKey, {}, function(result, isOk) {
						if(result.codeUrl) {
							var smsCodeUrl = result.codeUrl;
							Util.ajax.postJson(smsCodeUrl, {
								userId: _userId
							}, function(result, isOk) {	
								if(result.returnCode && result.returnCode != '0') {
									alert("获取短信验证码失败,请重试。");
								}
							});
						}
					});
				}

				function CapsLock_keyPress(e) {
					var e = arguments.callee.caller.arguments[0] || window.event;
					var keyCode = e.keyCode || e.which; //按键的keyCode。  
					var isShift = e.shiftKey || (keyCode == 16) || false; //shift键是否按住。  
					if(
						((keyCode >= 65 && keyCode <= 90) && !isShift) // CapsLock打开，且没有按住shift键。  
						||
						((keyCode >= 97 && keyCode <= 122) && isShift)) // CapsLock打开，且按住shift键。
					{
						isCapslockOn = true;
					} else {
						isCapslockOn = false;
					}
				}

				function CapsLock_keydown(e) {
					var keyCode = window.event ? e.keyCode : e.which;
					if(keyCode == 20 && isCapslockOn == true) {
						isCapslockOn = false;
					} else if(keyCode == 20 && isCapslockOn == false) {
						isCapslockOn = true;
					}
				}

				function isUppercase() {
					var pwd = $("input[name='l_p']");
					//keyPress可以判断当前CapsLock状态，但不能捕获CapsLock键。  
					$(document).keypress(CapsLock_keyPress);
					//keyDown可以捕获CapsLock键，但不能判断CapsLock的状态。  
					$(document).keydown(CapsLock_keydown);

					pwd.focus(function() {
						console.log(isCapslockOn);
						if(isCapslockOn == true) {
							console.log("大写锁定！");
							$(".UppercaseLock").removeClass("hide");
						} else {
							console.log("大写锁定关闭！");
							$(".UppercaseLock").addClass("hide");
						}
					});
					pwd.keyup(function() {

						console.log(isCapslockOn);
						if(isCapslockOn == true) {
							console.log("大写锁定！");
							$(".UppercaseLock").removeClass("hide");
						} else {
							console.log("大写锁定关闭！");
							$(".UppercaseLock").addClass("hide");
						}
					});

				}

				function pwdRuleVerification() {
					console.log("密码规则验证")
					var pattern = /(?=.*[\\!@#\\$%\\^&\\*]+)(?=.*[a-zA-Z]+)(?=.*[0-9]+).{6,}/;
					$("input[name='newpwd']").blur(function() {
						console.log("触发判断")
						var password = $("input[name='newpwd']").val();
						if(password == "") {
							$(".form_blk").find('.tips-pwdV').addClass('hide');
							return;
						}
						if(!pattern.test(password)) {
						    pwdFalg = false;
							$(".form_blk").find('.tips-pwdV').removeClass('hide');
							return;
						} else {
							pwdFalg = true;
							$(".form_blk").find('.tips-pwdV').addClass('hide');
						}
					});
					$("input[name='F_newpwd']").blur(function() {
                        console.log("触发判断")
                        var password = $("input[name='F_newpwd']").val();
                        if(password == "") {
                            $(".F_resPwdv1").addClass('hide');
                            return;
                        }
                        if(!pattern.test(password)) {
                            pwdFalg = false;
                            $(".F_resPwdv1").removeClass('hide');
                            return;
                        } else {
                            pwdFalg = true;
                            $(".F_resPwdv1").addClass('hide');
                        }
                    });
					$("input[name='renewpwd']").blur(function() {
						var password = $("input[name='renewpwd']").val();
						if(password == "") {
							$(".form_blk").find('.tips-pwdV1').addClass('hide');
							return;
						}
						if(!pattern.test(password)) {
						    pwdFalg = false;
							$(".form_blk").find('.tips-pwdV1').removeClass('hide');
							return;
						} else {
						    pwdFalg = true;
							$(".form_blk").find('.tips-pwdV1').addClass('hide');
						}
					});
					$("input[name='F_renewpwd']").blur(function() {
                        var password = $("input[name='F_renewpwd']").val();
                        if(password == "") {
                            $(".F_resPwdv1").addClass('hide');
                            return;
                        }
                        if(!pattern.test(password)) {
                            pwdFalg = false;
                            $(".F_resPwdv1").removeClass('hide');
                            return;
                        } else {
                            pwdFalg = true;
                            $(".F_resPwdv1").addClass('hide');
                        }
                    });
				}
                
                function F_resetPwd(){
                    var oldPwd = $("input[name='l_p']").val();
                    var newPwd=$("input[name='F_newpwd']").val();
                    var V_newPwd=$("input[name='F_renewpwd']").val();
                    var u =$("input[name='l_u']").val();
                    if(newPwd==V_newPwd){//两次新密码输入要相同
                        if(newPwd==""){//密码输入为空的提示
                            $(".F_resPwdV2").removeClass("hide");
                            return;
                        }
                        if(!pwdFalg){//如果密码规则不通过不允许提交
                            return;
                        }
                        if(oldPwd!=newPwd){//修改前的密码与要修改的密码不能相同
                        Util.ajax.postJson("/it/FresetPwd",{
                            userId: u,
                            oldPassword: $.md5(oldPwd),
                            newPwd: $.md5(newPwd)
                        },function(result, isok){
                            if(result.success){
                                $('.firstLanding').addClass('hide');
                                $('.F_E_P').removeClass('hide');
                            }else{
                                $(".F_errorTips span").text("修改失败，请稍后重试！");
                                $(".F_errorTips").removeClass("hide");
                            }
                        });
                    }else{
                        $(".F_errorTips span").text("不能与初始密码相同！");
                        $(".F_errorTips").removeClass("hide");
                    }
                    }else{
                        $(".F_errorTips span").text("两次密码输入不一致！");
                        $(".F_errorTips").removeClass("hide");
                    }
                }
                
				function eventInit() {
					//tipLocation();
					pwdRuleVerification();
					isUppercase();
					//首次登录重设密码密码不能为空
					$("input[name='F_newpwd']").focus(function(){
					    $(".F_resPwdV2").addClass("hide");
					});
					$("input").focus(function(){
					    $(".F_errorTips").addClass("hide");
					});
					$(".F_Next_btn").click(function(){
					    F_resetPwd();
                        /*$('input[name="reset_type"]').val('forget').attr('data-id', result.data);
                        $('input[name="u"]').val(u);*/
					});
					//登录重置
					$('.login-panel .reset').click(function() {
						$('input[name="l_u"],input[name="l_p"]').val('');
					});
					//忘记密码,重置密码面板重置、返回按钮操作
					$('.forget-panel .back,.reset-panel .back').click(function() {
						setTimeout("location.href='login.html'", 50);
					});
					$('.forget-panel .reset,.reset-panel .reset').click(function() {
						$('input[name="f_u"]').val('');
						$('input[name="f_m"]').val('');

						$('input[name="newpwd"]').val('');
						$('input[name="renewpwd"]').val('');
					});
					//重置密码错误提示隐藏
					$('input[name="newpwd"],input[name="renewpwd"]').focus(function() {
						$('.reset-panel .tips-info').addClass('hide');
					});

					//忘记密码错误提示隐藏
					$('input[name="f_u"],input[name="f_m"],input[name="f_sc"]').focus(function() {
						$('.forget-panel .tips-info').addClass('hide');
					});

					//设置登录验证码为禁用 
					$('input[name="l_sc"]').attr("disabled", true);
					//设置忘记密码的短信验证码禁用
					$('input[name="f_sc"]').attr("disabled", true);

					$('input[name="l_u"],input[name="l_p"]').focus(function() {
						$('#loginTips').addClass('hide');
						if($('input[name="l_u"]').val() == '' || $('input[name="l_p"]').val() == '') {
							$('input[name="l_sc"]').attr("disabled", true);
						} else {
							//$('input[name="l_sc"]').removeAttr("disabled");
						}
					});

					$('input[name="l_u"],input[name="l_p"]').keyup(function() {
						$('#loginTips').addClass('hide');
						if($('input[name="l_u"]').val() == '' || $('input[name="l_p"]').val() == '') {
							$('input[name="l_sc"]').attr("disabled", true);
						} else {
							//$('input[name="l_sc"]').removeAttr("disabled");
						}
					});

					//登录
					$('.login-panel .login_bt').click(function() {
						var u = $('input[name="l_u"]').val();
						var p = $('input[name="l_p"]').val();
						var sc = $('input[name="l_sc"]').val();

						if(u == '') {
							$('#loginTips .tips').text("请输入账号。");
							$('#loginTips').removeClass('hide');
							return;
						}

						if(p == '') {
							$('#loginTips .tips').text("请输入密码。");
							$('#loginTips').removeClass('hide');
							return;
						}

						if(sc == '') {
							$('#loginTips .tips').text("请点击获取验证码进行输入。");
							$('#loginTips').removeClass('hide');
							return;
						}

						if(u == '' || p == '' || sc == '') {
							return;
						}
						/* 隐藏历史回显信息  */
						$('#loginTips').addClass('hide');

						Util.ajax.postJson('/it/login', {
							userId: u,
							password: $.md5(p),
							smsCode: sc
						}, function(result, isErr) {
							if(result.success) {
								if(result.data && result.data == 'Expire') {
									alert("您的密码已过期，请修改。");
									//跳转到重置密码页面,进行密码重置 
									$('.login-panel').addClass('hide');
									$('.reset-panel').removeClass('hide');

									$('input[name="reset_type"]').val('expire').attr('data-id', result.rdmuid);
									$('input[name="u"]').val(u);
								} else if(result.data && result.data == 'First'){//首次登录
								    console.log("首次登录");
								    firstLanding();
								}else {
									//判断登录用户
									$cookie.set("com.cmos.boco.bomc.userId", u, 86400000);
									$cookie.set("com.cmos.boco.bomc.userName", result.data, 86400000);
									$cookie.set("com.cmos.boco.bomc.loginTime", getNowFormatDate(true), 86400000)
									var indexUrl = "index.html";
									location.href = indexUrl;
									/*
									    if (navigator.appName=="Netscape"){
									        var p = window.open (indexUrl,'','width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+ ',top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
									        if(!p){
									            alert("弹出的首页窗口被阻止了，请手动设置允许此窗口被打开。");
									            return;
									        }
									        var opened=window.open('about:blank','_self');
									        opened.opener=null;
									        opened.close();
									    }else{
									        var p = window.open (indexUrl,'','width='+(window.screen.availWidth-10)+',height='+(window.screen.availHeight-30)+ ',top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=yes,location=no, status=no');
									        if(!p){
									            alert("弹出的首页窗口被阻止了，请手动设置总是允许此窗口被打开。");
									            return;
									        }
									        window.opener=null;
									        window.open('', '_self');
									        window.close();
									    }*/
								}
							} else {
								$('#loginTips .tips').text(result.message);
								$('#loginTips').removeClass('hide');
							}
						});
					});
                    
					/* 忘记密码点击  */
					$('.login-panel .forget').click(function() {
						//设置忘记密码页 
						//                      $('.login-panel').addClass('hide');
						//                      $('.forget-panel').removeClass('hide');
						$(".tit_login").hide();
						$('.page-w').addClass('hide');
						$('.page-w-two').removeClass('hide');


						//初始化
						$('input[name="f_u"]').val('');
						$('input[name="f_m"]').val('');
						$('input[name="f_sc"]').val('').attr('disabled', true);

					});
					//首次登陆强制修改密码
                    function firstLanding(){
                        $(".tit_login").hide();
                        $('.page-w').addClass('hide');
                        $('.firstLanding').removeClass('hide');
                    }
                    
					/** 忘记密码获取验证码  */
					var tTimerFlag = false;
					$('#f_gsc').click(function() {
						var u = $('input[name="f_u"]').val();
						var m = $('input[name="f_m"]').val();
						if(u == '') {
							$('.forget-panel .tips-info span').text("请输入账号。");
							$('.forget-panel .tips-info').removeClass('hide');
							return;
						}

						if(m == '' || m.length != 11) {
							$('.forget-panel .tips-info span').text("请输入合法手机号。");
							$('.forget-panel .tips-info').removeClass('hide');
							return;
						}

						if(u == '' || m == '' || m.length != 11 || tTimerFlag) {
							return;
						}
						//点击发送短信按钮后倒计时60s
						var countdown = 60;

						function __Timer(obj) {
							if(countdown == 0) {
								//结束倒计时
								tTimerFlag = false;
								obj.text("获取验证码");
								countdown = 60;
								return;
							} else {
								obj.text('重新获取' + countdown + "s");
								countdown--;
							}
							setTimeout(function() {
								__Timer($('#f_gsc'));
							}, 1000);
						}
						//填写手机号与用户信息中的手机号是否一致 
						Util.ajax.postJson('/it/pwd/checkPnum', {
							userId: u,
							pnum: m
						}, function(result, isOk) {
							if(result.returnCode && result.returnCode != '0') {
								alert("手机号校验失败.");
							} else {
								if(result.success) { //校验成功,发送验证码
									if(tTimerFlag == true) {
										return;
									}
									$('input[name="f_sc"]').val('');
									$('input[name="f_sc"]').removeAttr('disabled');
									$('input[name="f_sc"]').focus();
									tTimerFlag = true;
									//发送验证码
									sendSmsCode(u);
									__Timer($('#f_gsc'));

								} else {
									$('.forget-panel .tips-info span').text(result.message);
									$('.forget-panel .tips-info').removeClass('hide');
									//alert(result.message);
									return;
								}
							}
						});
					});

					/** 忘记密码提交到重置密码  */
					$('.forget-panel .login_bt').click(function() {
						var u = $('input[name="f_u"]').val();
						var m = $('input[name="f_m"]').val();
						var sc = $('input[name="f_sc"]').val();

						if(u == '') {
							$('.forget-panel .tips-info span').text("请输入账号。");
							$('.forget-panel .tips-info').removeClass('hide');
							return;
						}

						if(m == '' || m.length != 11) {
							$('.forget-panel .tips-info span').text("请输入合法手机号。");
							$('.forget-panel .tips-info').removeClass('hide');
							return;
						}

						if(sc == '') {
							$('.forget-panel .tips-info span').text("请点击获取验证码进行输入。");
							$('.forget-panel .tips-info').removeClass('hide');
							return;
						}

						if(u == '' || m == '' || m.length != 11 || sc == '') {
							return;
						}

						Util.ajax.postJson('/it/pwd/forgetPwd', {
							userId: u,
							pnum: m,
							smsCode: sc
						}, function(result, isErr) {
							if(result.success) {
								//跳转到重置密码页面,进行密码重置 
								//                              $('.forget-panel').addClass('hide');
								//                              $('.reset-panel').removeClass('hide');

								$('.page-w-two').addClass('hide');
								$('.page-w-three').removeClass('hide');

								$('input[name="reset_type"]').val('forget').attr('data-id', result.data);
								$('input[name="u"]').val(u);

							} else { //显示错误信息
								$('.forget-panel .tips-info span').text(result.message);
								$('.forget-panel .tips-info').removeClass('hide');
							}
						});
					});
					//重置密码 
					$('.reset-panel .login_bt').click(function() {
						var u = $('input[name="u"]').val();
						var v = $('input[name="newpwd"]').val();
						var rv = $('input[name="renewpwd"]').val();
						/* if(v == '' || rv == '' || v != rv) {
						    $('.reset-panel .tips-info span').text("两次输入密码不一致.");
						    $('.reset-panel .tips-info').removeClass('hide');
						    return;
						} */
						if(v == '' || rv == '') {
							$('.reset-panel .tips-info span').text("密码不能为空。");
							$('.reset-panel .tips-info').removeClass('hide');
							return;
						} else if(v != rv) {
							$('.reset-panel .tips-info span').text("两次输入密码不一致。");
							$('.reset-panel .tips-info').removeClass('hide');
							return;
						}
						//var resetType = $('input[name="reset_type"]').val();//expire or forget
						var rdmuid = rdmuid = $('input[name="reset_type"]').attr('data-id');
						console.log("--------" + pwdFalg);
						if(pwdFalg) {
							Util.ajax.postJson('/it/pwd/resetPwd', {
								userId: u,
								newPwd: $.md5(v),
								rdmuid: rdmuid
							}, function(result, isErr) {
								if(result.success) {
									//alert('重置密码成功!');
									//                              setTimeout("location.href='login.html'", 200);
									$('.page-w-three').addClass('hide');
									$('.page-w-si').removeClass('hide');
								} else {
									$('.reset-panel .tips-info span').text(result.message || result.returnMessage);
									$('.reset-panel .tips-info').removeClass('hide');
								}
							});
						}

					});

				}
				//END
			});
		</script>
		<!--   浏览器兼容问题     -->
		<script>
			function myBrowser() {
				var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
				var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器
				var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
				//		    var isFF = userAgent.indexOf("Firefox") > -1; //判断是否Firefox浏览器
				var isSafari = userAgent.indexOf("Safari") > -1; //判断是否Safari浏览器
				if(isIE) {
					var IE5 = IE55 = IE6 = IE7 = IE8 = IE9 = IE10 = false;
					var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
					reIE.test(userAgent);
					var fIEVersion = parseFloat(RegExp["$1"]);
					IE55 = fIEVersion == 5.5;
					IE6 = fIEVersion == 6.0;
					IE7 = fIEVersion == 7.0;
					IE8 = fIEVersion == 8.0;
					IE9 = fIEVersion == 9.0;
					IE10 = fIEVersion == 10.0;
					if(IE55) {
						return "IE55";
					}
					if(IE6) {
						return "IE6";
					}
					if(IE7) {
						return "IE7";
					}
					if(IE8) {
						return "IE8";
					}
					if(IE9) {
						return "IE9";
					}
					if(IE10) {
						return "IE10";
					}
				} //isIE end
				//		    if (isFF) {
				//		        return "FF";
				//		    }
				if(isOpera) {
					return "Opera";
				}
			} //myBrowser() end
			//以下是调用上面的函数
			//		if (myBrowser() == "FF") {		    
			//		    $('.winw').show();
			//		}
			if(myBrowser() == "Opera") {
				$('.winw').show();
				$('.winw-w').show();
			}
			if(myBrowser() == "Safari") {
				$('.winw').show();
				$('.winw-w').show();
			}
			if(myBrowser() == "IE55") {
				$('.winw').show();
				$('.winw-w').show();
				alert("您的浏览器版本过低,可能有安全风险，请使用高版本浏览器");
				window.location.href = "https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads";
			}
			if(myBrowser() == "IE6") {
				$('.winw').show();
				$('.winw-w').show();
				alert("您的浏览器版本过低,可能有安全风险，请使用高版本浏览器");
				window.location.href = "https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads";
			}
			if(myBrowser() == "IE7") {
				$('.winw').show();
				$('.winw-w').show();
				alert("您的浏览器版本过低，可能有安全风险，请使用高版本浏览器");
				window.location.href = "https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads";
			}
			if(myBrowser() == "IE8") {
				$('.winw').show();
				$('.winw-w').show();
				alert("您的浏览器版本过低,可能有安全风险，请使用高版本浏览器");
				window.location.href = "https://support.microsoft.com/zh-cn/help/17621/internet-explorer-downloads";
			}
			if(myBrowser() == "IE9") {
				$('.winw').show();
				$('.winw-w').show();
			}
			if(myBrowser() == "IE10") {
				$('.winw').show();
				$('.winw-w').show();
			}
		</script>
	</body>

</html>